/**
 * @file BallPerceptor.h
 * This file declares a module that provides the ball percept.
 * If possible, it uses the full YCbCr422 image.
 * @author Colin Graf
 * @author marcel
 * @author Florian Maaß
 * @author Thomas Röfer
 * @author Yongqi Lee modified to detect real ball
 */

#pragma once 

#ifdef TARGET_ROBOT
#define IS_FULL_SIZE true
#else
#define IS_FULL_SIZE theImage.isFullSize
#endif

#define RAD2DEG 57.29577951f

//#define SAVE_IMAGE
//#define SAVE_SAMPLE
//#define SVM_CHECK

#include <iostream>
#include <map>
#include <fstream>
#include <cmath>
#include <set>
#include <chrono>
#include <algorithm>

#include "Tools/Module/Module.h"
#include "Representations/Configuration/FieldDimensions.h"
#include "Representations/Configuration/ColorTable.h"
#include "Representations/Infrastructure/SensorData/KeyStates.h"
#include "Representations/Perception/FieldBoundary.h"
#include "Representations/Perception/CameraMatrix.h"
#include "Representations/Perception/ImageCoordinateSystem.h"
#include "Representations/Perception/BallPercept.h"
#include "Representations/Modeling/Odometer.h"
#include "Representations/Modeling/RobotPose.h"
#include "Representations/Perception/BallSpots.h"
#include "Representations/Perception/PlayersPercept.h"
#include "Tools/ImageProcessing/Sobel.h"
#include "color.h"

MODULE(
    BallPerceptor,
    {,
    REQUIRES(FieldDimensions),
    REQUIRES(Image),
    REQUIRES(CameraMatrix),
    REQUIRES(ImageCoordinateSystem),
    REQUIRES(CameraInfo),
    REQUIRES(ColorTable),
	REQUIRES(FieldBoundary),
    REQUIRES(KeyStates),
    REQUIRES(Odometer),
//    REQUIRES(BlackAndWhiteBallPercept),
    REQUIRES(BallSpots),
    REQUIRES(PlayersPercept),
    USES(RobotPose),
    PROVIDES(BallPercept),
    DEFINES_PARAMETERS( {, (float)(2.f) clippingApproxRadiusScale, (float)(2.5f) clippingApproxRadiusPixelBonus, (unsigned)(4) scanPixelTolerance, (unsigned)(4) refineMaxPixelCount, (float)(1.3f) checkMaxRadiusDifference,  // 增大放宽条件
    (float)(0.7f) checkMinRadiusDifference, (float)(12.f) checkMaxRadiusPixelBonus,// 增大放宽条件
    (float)(6.f) checkMinRadiusPixelBonus, (float)(1.1f) checkOutlineRadiusScale, (float)(4.f) checkOutlineRadiusPixelBonus, (unsigned)(20) orangeSkipping, (unsigned)(12) minBallSpotSize, (float)(0.40f) maxFallPointPercent,// [0, 1]
    (float)(0.40f) maxGreenPercent,// [0, 1]
    }),
    });

/**
 * The class scales the input and output data if full size images
 * are avalable.
 */
class BallPerceptorScaler : public BallPerceptorBase
{
//private:
//  using BallPerceptorBase::theImage; // prevent direct access to image

 protected:
  CameraInfo theCameraInfo;
  BallSpots theBallSpots;
  ImageCoordinateSystem theImageCoordinateSystem;

  /**
   * The only access to image pixels.
   * @param y The y coordinate of the pixel in the range defined in theCameraInfo.
   * @param y The y coordinate of the pixel in the range defined in theCameraInfo.
   * @param The pixel as a temporary object. Do not use yCbCrPadding of that pixel.
   */
  const Image::Pixel getPixel(int y, int x) const
  {
//    if (theCameraInfo.camera == CameraInfo::upper && IS_FULL_SIZE)
//      return theImage.getFullSizePixel(y, x);
//    else
    return theImage[y][x];
  }

  /**
   * Update the copies of input representations that contain data
   * that might have to be scaled up.
   * Must be called in each cycle before any computations are performed.
   */
  void scaleInput();

  /**
   * Scale down the output if required.
   * @param ballPercept The ball percept the fields of which might be scaled.
   */
  void scaleOutput(BallPercept& ballPercept) const;

  /**
   * Scale down a single value if required.
   * This is only supposed to be used in debug drawings.
   * @param value The value that might be scaled.
   * @return The scaled value.
   */
  template<typename T> T scale(T value) const
  {
    if (theCameraInfo.camera == CameraInfo::upper && IS_FULL_SIZE)
      return value / (T) 2;
    else
      return value;
  }

};

/**
 * The actual ball perceptor.
 * It is basically identical to the module "BallPerceptor".
 */
class BallPerceptor : public BallPerceptorScaler
{
private:

  struct Point
  {
    unsigned short x;
    unsigned short y;

    Point(unsigned short x, unsigned short y) : x(x), y(y) {}

    bool operator<(const Point& rhs) const
    {
      return y < rhs.y ? true : y == rhs.y && x < rhs.x;
    }
  };

 
  struct circle
  {
    float x, y, r, q;
  };

  struct Ball
  {
    int x, y, radius, q;
    bool found;
  };
  
  struct candidateBall
  {
      Ball ball;
      float disError;
      float score;
  };
  
  struct BallPoint
  {
    Vector2i step;
    Vector2i start;
    Vector2i point;
    Vector2f pointf;
    bool atBorder = false;
    bool isValid = false;
  };

  float sqrMaxBallDistance; /**< The square of the maximal allowed ball distance. */

  void update(BallPercept& ballPercept);

  void fromBallSpots(BallPercept&);

  /** ########## begin: analyzing chain for possible balls. ########## */

  // limits of the image where a ball should be found
  static const int left = 2;
  int right;  //right, horizon and height are set in update()
  int horizon;
  int height;
  


  static const int NUM_STAR_SCANLINES = 16;
  static const int NUM_STAR_SCANLINE_CANDIDATES = 2 * NUM_STAR_SCANLINES;
  const float maxBallRadius = 120;

  BallPercept::Status analyzeBallSpot(const BallSpot& ballspot,
                                      BallPercept& ballPercept);
  bool checkNoNoise(const BallSpot& ballSpot) const;
  bool checkBallSpot(const BallSpot& ballSpot);

  float approxRadius1; /**< Bearing based approximation of the radius. */

  bool searchBallPoints(const BallSpot& ballSpot);

  Image::Pixel startPixel; /**< The ball spot pixel. */
  BallPoint ballPoints[8]; /**< Points on the outer edge of the ball. */
  Vector2i approxCenter2;
  int totalPixelCount;
   std::chrono::high_resolution_clock::time_point startT,endT;
  bool searchBallPoint(const Vector2i& start, Image::Pixel startPixel,
                       const Vector2i& step, float maxLength,
                       BallPoint& ballPoint);
  void drawBall(const Vector2i& pos, float approxDiameter,
                unsigned char opacity) const;
  bool checkBallPoints();
  bool getBallFromBallPoints(Vector2f& center, float& radius) const;

  unsigned int validBallPoints; /**< Count of usable points on the outer edge of the ball. */

  bool calculateBallInImage(BallPercept& ballPercept) const;
  bool checkBallInImage(BallPercept& ballPercept) const;
  bool isOnRobots(int x, int y) const;
  bool calculateBallOnField(BallPercept& ballPercept) const;
  bool checkBallOnField(BallPercept& ballPercept) const;
  bool checkColorPercent(BallPercept& ballPercept) const;
  bool raytraceCircle(const Image& img, Vector2f pos,
                      Vector2f points[NUM_STAR_SCANLINES], color ball);
  Vector2f getInnerPoint(Vector2f points[NUM_STAR_SCANLINES], Vector2f guess);
  void updateBallColor(const Image& img, Vector2f& ballColor, Vector2f *points, int n);
  float guessDiameter(Vector2f points[NUM_STAR_SCANLINES]);
  circle ransacCircle(Vector2f points[NUM_STAR_SCANLINE_CANDIDATES],
                      float maxDistEdge);
  circle getCircle(float x1, float y1, float x2, float y2, float x3, float y3);
  circle newCircle(float x, float y, float r, float q);
  Ball newBall(float x, float y, float radius, bool found);
  Ball newBall(float x, float y, float radius, bool found,  float q);
  Ball fitBall(const BallSpot& ballSpot);
  Ball fitBall(const Vector2f& center, const float searchR, Vector2f& ballColor);
  color getBallColor(const Image& img, BallSpot guess);
  color getBallColor(const Image& img, const Vector2f& center);
  bool Classifier(BallPerceptor::Ball &b,float* val);
  bool distanceClassifier(BallPerceptor::Ball &b,float& v);
  float ballSpotsClassifier(BallSpot & bs,float * t);
  bool possibleGreen(const Image::Pixel& p) const;
  float otsuThreshold(int * grayImg);
  bool classifyUsingOtsu(int * grayImg, float thre, float * val);
  bool classifyBalls(BallPerceptor::Ball & b);
  bool classifyBalls2(BallPerceptor::Ball & b);
  bool classifyBallSpots(BallSpot & bs);
  void SearchSpotsWindow(BallSpot & bs);
  void CreateImageInHSVSpace(int l, int r, int t, int b, std::vector<Image::Pixel>& p);
  bool possibleGrayScale(const Image::Pixel& p) const;
  bool raytraceCircle(const Image& img, Vector2f pos,
                                   Vector2f points[NUM_STAR_SCANLINES],
                                   Vector2f& ballColor,float searchR);
  float searchEdges(const Image& img, Vector2f pos,
                                     Vector2f points[NUM_STAR_SCANLINES * 2],
                                     Vector2f& ballColor,float searchR);
  void extractHogFeature(float image[30][30], float normalised_descriptor[2916], int orientations = 9, int pixel_per_cell = 3,
		  	  	  	  	  	  int cells_per_blocks = 2, bool normalise = true);

  float SVMclassifier(float HOG_descriptor[2916]);

  float SVM_test(BallPerceptor::Ball & b);

  bool isWhite(const Image::Pixel* p) const;

  /** ########## end: analyzing chain for possible balls. ########## */

  void buildDistanceMap(Vector2f& origin, std::vector<BallSpot>& ballSpots);
  std::map<float, unsigned int> distance; /** ballSpots' distance to prevPositionInImage */
  float tansig(float per,float ref);
  float otsuThreshold(BallPerceptor::Ball & b);

  /** SVM parameters for ball discrimination.
   *  Temporarily using linear kernel.
   *  res = (sample + shift) * factor' +bias.
   *  if res < 0 sample is true ball.
   */
  const double bias =   -2.7393674e-01;
  const double shift[900] =
  { -3.6944479e-01, -3.6847001e-01, -3.6688038e-01, -3.6474342e-01,
      -3.6442847e-01, -3.6542571e-01, -3.6514079e-01, -3.6400857e-01,
      -3.6670043e-01, -3.6919732e-01, -3.7225659e-01, -3.7630563e-01,
      -3.7762530e-01, -3.8175683e-01, -3.8175683e-01, -3.8045215e-01,
      -3.8016721e-01, -3.8015219e-01, -3.7770781e-01, -3.7145429e-01,
      -3.6967719e-01, -3.6957972e-01, -3.6849999e-01, -3.6727026e-01,
      -3.6694784e-01, -3.6659544e-01, -3.6575563e-01, -3.6501331e-01,
      -3.6303378e-01, -3.6168409e-01, -3.6705286e-01, -3.6674542e-01,
      -3.6591312e-01, -3.6473592e-01, -3.6480338e-01, -3.6508079e-01,
      -3.6529075e-01, -3.6562068e-01, -3.6858248e-01, -3.7349380e-01,
      -3.7862260e-01, -3.8381886e-01, -3.9070221e-01, -3.9526114e-01,
      -3.9700823e-01, -3.9187193e-01, -3.9427136e-01, -3.9162447e-01,
      -3.8419376e-01, -3.8150939e-01, -3.7654556e-01, -3.7215911e-01,
      -3.6994713e-01, -3.7001461e-01, -3.6933978e-01, -3.6936975e-01,
      -3.6746521e-01, -3.6409102e-01, -3.6223147e-01, -3.6079180e-01,
      -3.5991454e-01, -3.6040193e-01, -3.6061191e-01, -3.6070186e-01,
      -3.6117423e-01, -3.6217149e-01, -3.6342370e-01, -3.6677541e-01,
      -3.7252653e-01, -3.8387134e-01, -3.9513368e-01, -4.0862297e-01,
      -4.2238218e-01, -4.3114759e-01, -4.3801597e-01, -4.3382446e-01,
      -4.3197240e-01, -4.2818581e-01, -4.1930042e-01, -4.1509391e-01,
      -4.0890038e-01, -3.9781801e-01, -3.8597084e-01, -3.8021971e-01,
      -3.7473097e-01, -3.7264648e-01, -3.7191163e-01, -3.6921230e-01,
      -3.6730776e-01, -3.6319873e-01, -3.6036444e-01, -3.6133173e-01,
      -3.6199907e-01, -3.6256891e-01, -3.6257641e-01, -3.6559818e-01,
      -3.6973718e-01, -3.8001724e-01, -3.9765307e-01, -4.1828067e-01,
      -4.4102276e-01, -4.6228020e-01, -4.7888126e-01, -4.8838154e-01,
      -4.9734190e-01, -4.9406514e-01, -4.9405766e-01, -4.8521727e-01,
      -4.8115323e-01, -4.7437485e-01, -4.6512954e-01, -4.4778615e-01,
      -4.3138004e-01, -4.1229708e-01, -3.9280919e-01, -3.8035465e-01,
      -3.7246652e-01, -3.6923480e-01, -3.6784012e-01, -3.6418101e-01,
      -3.6391111e-01, -3.6356620e-01, -3.6513330e-01, -3.6539572e-01,
      -3.6754022e-01, -3.7319389e-01, -3.8572340e-01, -4.0672590e-01,
      -4.3064521e-01, -4.6246014e-01, -4.8346268e-01, -4.9584224e-01,
      -5.0262063e-01, -5.1230834e-01, -5.1458029e-01, -5.1670229e-01,
      -5.1445284e-01, -5.1779703e-01, -5.2094628e-01, -5.1854685e-01,
      -5.1025381e-01, -4.9147828e-01, -4.7849135e-01, -4.5956582e-01,
      -4.3159749e-01, -4.0558616e-01, -3.8771792e-01, -3.7403364e-01,
      -3.6950472e-01, -3.6645297e-01, -3.6456344e-01, -3.6477338e-01,
      -3.6742029e-01, -3.6849249e-01, -3.7353129e-01, -3.9392644e-01,
      -4.2161737e-01, -4.4996064e-01, -4.7746412e-01, -5.0475764e-01,
      -5.1176845e-01, -5.0927905e-01, -5.0579238e-01, -5.1646235e-01,
      -5.2063886e-01, -5.2327073e-01, -5.2249092e-01, -5.3025906e-01,
      -5.3603267e-01, -5.3524538e-01, -5.3837964e-01, -5.2833951e-01,
      -5.2066884e-01, -5.0991638e-01, -4.8230046e-01, -4.4942077e-01,
      -4.1367676e-01, -3.8948749e-01, -3.7623065e-01, -3.6963221e-01,
      -3.6520079e-01, -3.6608556e-01, -3.6739778e-01, -3.7040452e-01,
      -3.8324900e-01, -4.1871559e-01, -4.5197018e-01, -4.7659433e-01,
      -4.9391520e-01, -4.9987630e-01, -4.9551232e-01, -4.9548982e-01,
      -5.0020621e-01, -5.1521762e-01, -5.1914672e-01, -5.2884189e-01,
      -5.2952425e-01, -5.3685750e-01, -5.3761481e-01, -5.3460055e-01,
      -5.3331833e-01, -5.2506279e-01, -5.1865185e-01, -5.1650732e-01,
      -5.0339295e-01, -4.8170809e-01, -4.4780864e-01, -4.0816557e-01,
      -3.8429122e-01, -3.6909984e-01, -3.6401604e-01, -3.6406853e-01,
      -3.6691038e-01, -3.7701795e-01, -4.0320923e-01, -4.4429949e-01,
      -4.6818130e-01, -4.8170058e-01, -4.7616687e-01, -4.7645933e-01,
      -4.7536459e-01, -4.8451243e-01, -5.0563493e-01, -5.1982154e-01,
      -5.2515278e-01, -5.3711994e-01, -5.3811720e-01, -5.4759495e-01,
      -5.4831476e-01, -5.4247368e-01, -5.3835713e-01, -5.2737975e-01,
      -5.1654481e-01, -5.1341054e-01, -5.0426272e-01, -4.9367526e-01,
      -4.7545459e-01, -4.3732613e-01, -4.0347917e-01, -3.7633563e-01,
      -3.6640048e-01, -3.6649045e-01, -3.7300641e-01, -3.9652835e-01,
      -4.2934053e-01, -4.5799874e-01, -4.6568440e-01, -4.6150037e-01,
      -4.5285491e-01, -4.5301990e-01, -4.5914595e-01, -4.7651183e-01,
      -5.0259066e-01, -5.2245341e-01, -5.3432310e-01, -5.4461066e-01,
      -5.4457318e-01, -5.5429087e-01, -5.5708018e-01, -5.4674766e-01,
      -5.3160875e-01, -5.1134106e-01, -4.9922393e-01, -4.9389269e-01,
      -4.8283282e-01, -4.8813408e-01, -4.8701684e-01, -4.6057812e-01,
      -4.2631875e-01, -3.8953250e-01, -3.6609304e-01, -3.6667041e-01,
      -3.8399882e-01, -4.1285194e-01, -4.4282232e-01, -4.5526937e-01,
      -4.5553180e-01, -4.4513929e-01, -4.3931316e-01, -4.4531174e-01,
      -4.5712144e-01, -4.7620440e-01, -5.0370787e-01, -5.2582012e-01,
      -5.4141641e-01, -5.5141904e-01, -5.5108161e-01, -5.5946461e-01,
      -5.5956959e-01, -5.4460317e-01, -5.2000150e-01, -4.9500992e-01,
      -4.7918869e-01, -4.7390994e-01, -4.6432723e-01, -4.6782138e-01,
      -4.7562702e-01, -4.6944099e-01, -4.4316725e-01, -4.0710831e-01,
      -3.6454840e-01, -3.7150677e-01, -3.9313164e-01, -4.2688111e-01,
      -4.4990815e-01, -4.5128033e-01, -4.4468939e-01, -4.3889325e-01,
      -4.4205003e-01, -4.4781615e-01, -4.5956587e-01, -4.7774154e-01,
      -5.0157835e-01, -5.2524274e-01, -5.3382072e-01, -5.4826228e-01,
      -5.4878716e-01, -5.5411840e-01, -5.4581787e-01, -5.2953922e-01,
      -5.0717953e-01, -4.8334271e-01, -4.6556441e-01, -4.5556930e-01,
      -4.4597907e-01, -4.5176770e-01, -4.6144792e-01, -4.6624675e-01,
      -4.5310989e-01, -4.1799573e-01, -3.6660293e-01, -3.7960485e-01,
      -3.9928020e-01, -4.3274473e-01, -4.4993064e-01, -4.4966823e-01,
      -4.3959810e-01, -4.4303228e-01, -4.5109288e-01, -4.5730888e-01,
      -4.7225286e-01, -4.8508230e-01, -5.0391781e-01, -5.2483786e-01,
      -5.3217859e-01, -5.4380085e-01, -5.4533798e-01, -5.4526301e-01,
      -5.3657255e-01, -5.1798446e-01, -4.9620966e-01, -4.7935365e-01,
      -4.6105047e-01, -4.5081543e-01, -4.3822592e-01, -4.3846587e-01,
      -4.4831103e-01, -4.5538935e-01, -4.5081544e-01, -4.2218723e-01,
      -3.6885987e-01, -3.8090955e-01, -4.0818806e-01, -4.3848835e-01,
      -4.4939830e-01, -4.4997566e-01, -4.4111275e-01, -4.4279985e-01,
      -4.5064299e-01, -4.6290256e-01, -4.7322764e-01, -4.8690436e-01,
      -5.0182584e-01, -5.1590749e-01, -5.2059385e-01, -5.3184870e-01,
      -5.3153377e-01, -5.2618753e-01, -5.1563754e-01, -4.9697446e-01,
      -4.8215049e-01, -4.6853374e-01, -4.5369474e-01, -4.4631651e-01,
      -4.3335209e-01, -4.2656619e-01, -4.3562402e-01, -4.4704383e-01,
      -4.4800360e-01, -4.2475915e-01, -3.6592809e-01, -3.8032467e-01,
      -4.1067748e-01, -4.3553407e-01, -4.4459193e-01, -4.5302744e-01,
      -4.4964571e-01, -4.5248755e-01, -4.6390732e-01, -4.7593448e-01,
      -4.8722680e-01, -4.9971131e-01, -5.0677465e-01, -5.1913920e-01,
      -5.2091628e-01, -5.2182357e-01, -5.2205603e-01, -5.1475274e-01,
      -5.0457767e-01, -4.8998613e-01, -4.7961607e-01, -4.6719905e-01,
      -4.5318487e-01, -4.4198252e-01, -4.3065274e-01, -4.2639373e-01,
      -4.2556891e-01, -4.4513179e-01, -4.4538674e-01, -4.2631876e-01,
      -3.6736772e-01, -3.8104448e-01, -4.1418664e-01, -4.3782851e-01,
      -4.4654145e-01, -4.5452707e-01, -4.5166272e-01, -4.5273499e-01,
      -4.6321000e-01, -4.7777905e-01, -4.8703183e-01, -4.9097589e-01,
      -4.9614218e-01, -5.0151839e-01, -5.0344543e-01, -5.0066359e-01,
      -5.0132345e-01, -4.9406517e-01, -4.8964122e-01, -4.7825144e-01,
      -4.7149552e-01, -4.6395981e-01, -4.5248753e-01, -4.3851835e-01,
      -4.2699359e-01, -4.2742849e-01, -4.3260226e-01, -4.5128030e-01,
      -4.4944328e-01, -4.3224988e-01, -3.6813257e-01, -3.8295656e-01,
      -4.1440408e-01, -4.3931319e-01, -4.6015071e-01, -4.6806883e-01,
      -4.7337758e-01, -4.7191542e-01, -4.7285271e-01, -4.7985604e-01,
      -4.7996102e-01, -4.7984104e-01, -4.8433998e-01, -4.8987365e-01,
      -4.8524724e-01, -4.8368763e-01, -4.8442245e-01, -4.8133320e-01,
      -4.7555206e-01, -4.6523450e-01, -4.6410977e-01, -4.6283507e-01,
      -4.5397220e-01, -4.4036293e-01, -4.3117011e-01, -4.3396694e-01,
      -4.5016310e-01, -4.5476701e-01, -4.5397969e-01, -4.3703373e-01,
      -3.6694785e-01, -3.7851012e-01, -4.1062497e-01, -4.3671129e-01,
      -4.5709894e-01, -4.6911107e-01, -4.8001350e-01, -4.8164062e-01,
      -4.8383760e-01, -4.8355266e-01, -4.8300531e-01, -4.8077082e-01,
      -4.7936114e-01, -4.8149814e-01, -4.7733661e-01, -4.7862634e-01,
      -4.7902372e-01, -4.7737413e-01, -4.7298018e-01, -4.6570690e-01,
      -4.7273273e-01, -4.7069320e-01, -4.6125296e-01, -4.5409967e-01,
      -4.4667643e-01, -4.5002813e-01, -4.6101304e-01, -4.5973084e-01,
      -4.5676154e-01, -4.3959810e-01, -3.6608556e-01, -3.7555582e-01,
      -4.0719081e-01, -4.3410189e-01, -4.5504443e-01, -4.6776142e-01,
      -4.7819894e-01, -4.7872382e-01, -4.7801144e-01, -4.7325010e-01,
      -4.6873618e-01, -4.6702657e-01, -4.6174783e-01, -4.5930342e-01,
      -4.5758635e-01, -4.6286507e-01, -4.6286508e-01, -4.6416227e-01,
      -4.6039066e-01, -4.5624415e-01, -4.6428226e-01, -4.6591687e-01,
      -4.6009824e-01, -4.5557681e-01, -4.5577925e-01, -4.6551944e-01,
      -4.7444233e-01, -4.7390996e-01, -4.6604431e-01, -4.4505682e-01,
      -3.6333371e-01, -3.6974468e-01, -3.9928767e-01, -4.2488661e-01,
      -4.4442698e-01, -4.5843363e-01, -4.6798635e-01, -4.6623927e-01,
      -4.6263265e-01, -4.5457205e-01, -4.5291494e-01, -4.5131031e-01,
      -4.4492185e-01, -4.4360215e-01, -4.3861584e-01, -4.4429949e-01,
      -4.4947326e-01, -4.5187269e-01, -4.5014812e-01, -4.5032806e-01,
      -4.6216024e-01, -4.7085818e-01, -4.7080569e-01, -4.6985343e-01,
      -4.6774642e-01, -4.7618942e-01, -4.7930867e-01, -4.7215537e-01,
      -4.6400480e-01, -4.3813596e-01, -3.6208900e-01, -3.6666292e-01,
      -3.9074721e-01, -4.1528140e-01, -4.3548910e-01, -4.4858846e-01,
      -4.5781127e-01, -4.5352979e-01, -4.4637650e-01, -4.4348967e-01,
      -4.4253740e-01, -4.4002549e-01, -4.3671130e-01, -4.3059274e-01,
      -4.2344693e-01, -4.3149254e-01, -4.4021296e-01, -4.4363214e-01,
      -4.4296480e-01, -4.4464439e-01, -4.5583174e-01, -4.6584188e-01,
      -4.7120311e-01, -4.7265028e-01, -4.7295016e-01, -4.7498220e-01,
      -4.7498968e-01, -4.6749147e-01, -4.5630412e-01, -4.3323960e-01,
      -3.6596558e-01, -3.6727028e-01, -3.8075958e-01, -4.0118475e-01,
      -4.1729093e-01, -4.3270725e-01, -4.3926068e-01, -4.3248228e-01,
      -4.2853822e-01, -4.2985791e-01, -4.3103515e-01, -4.3182244e-01,
      -4.3022534e-01, -4.2602632e-01, -4.1812322e-01, -4.2702359e-01,
      -4.3799348e-01, -4.4453945e-01, -4.4180259e-01, -4.4547672e-01,
      -4.5362726e-01, -4.6128297e-01, -4.6405730e-01, -4.6392234e-01,
      -4.6166537e-01, -4.6425977e-01, -4.6609684e-01, -4.5534435e-01,
      -4.4225997e-01, -4.2041763e-01, -3.6552319e-01, -3.6598058e-01,
      -3.7528586e-01, -3.8582087e-01, -3.9913021e-01, -4.1510143e-01,
      -4.2364940e-01, -4.1614367e-01, -4.1225208e-01, -4.1238705e-01,
      -4.1501892e-01, -4.2044016e-01, -4.2124247e-01, -4.1882053e-01,
      -4.1417915e-01, -4.2579389e-01, -4.3867583e-01, -4.4297982e-01,
      -4.3836092e-01, -4.4169012e-01, -4.4725378e-01, -4.4870095e-01,
      -4.5286994e-01, -4.5295244e-01, -4.4940578e-01, -4.4805611e-01,
      -4.4512429e-01, -4.3706370e-01, -4.2522402e-01, -4.0649348e-01,
      -3.6705283e-01, -3.6703034e-01, -3.7013463e-01, -3.7715293e-01,
      -3.8499607e-01, -3.9659582e-01, -4.0951526e-01, -4.0690588e-01,
      -4.0297681e-01, -3.9568106e-01, -3.9794550e-01, -4.0593860e-01,
      -4.1010760e-01, -4.1077495e-01, -4.0612604e-01, -4.1702099e-01,
      -4.3096767e-01, -4.3709371e-01, -4.3474678e-01, -4.3605147e-01,
      -4.3584148e-01, -4.3716120e-01, -4.4268738e-01, -4.4106025e-01,
      -4.3189741e-01, -4.2578639e-01, -4.2361940e-01, -4.1611368e-01,
      -4.0599859e-01, -3.8617330e-01, -3.6493834e-01, -3.6430097e-01,
      -3.6458592e-01, -3.6657295e-01, -3.7033706e-01, -3.8192929e-01,
      -3.9354404e-01, -3.9366402e-01, -3.8927756e-01, -3.8627079e-01,
      -3.8415628e-01, -3.8760546e-01, -3.9286170e-01, -3.9074720e-01,
      -3.8742549e-01, -4.0091479e-01, -4.1715591e-01, -4.2712108e-01,
      -4.2595887e-01, -4.2632628e-01, -4.2361190e-01, -4.2478911e-01,
      -4.2640123e-01, -4.1939041e-01, -4.0859296e-01, -4.0258689e-01,
      -4.0269189e-01, -4.0020246e-01, -3.8999737e-01, -3.7114686e-01,
      -3.6424101e-01, -3.6263638e-01, -3.6107674e-01, -3.6190154e-01,
      -3.6176659e-01, -3.6504333e-01, -3.7362127e-01, -3.7718294e-01,
      -3.7251906e-01, -3.7218162e-01, -3.7161925e-01, -3.7196419e-01,
      -3.7724291e-01, -3.7659804e-01, -3.7716042e-01, -3.8824281e-01,
      -4.0194204e-01, -4.1171974e-01, -4.1231957e-01, -4.1407415e-01,
      -4.1135980e-01, -4.0846549e-01, -4.0245191e-01, -3.9366399e-01,
      -3.8956249e-01, -3.8558094e-01, -3.8264164e-01, -3.8082707e-01,
      -3.6801259e-01, -3.5739512e-01, -3.5992950e-01, -3.5876724e-01,
      -3.5744009e-01, -3.5780002e-01, -3.5618791e-01, -3.5315864e-01,
      -3.5624790e-01, -3.5969709e-01, -3.5975706e-01, -3.5978707e-01,
      -3.6401604e-01, -3.6450345e-01, -3.6915982e-01, -3.7134182e-01,
      -3.7517340e-01, -3.8432124e-01, -3.9191692e-01, -3.9781801e-01,
      -4.0137967e-01, -4.0268436e-01, -3.9585348e-01, -3.8569339e-01,
      -3.7432609e-01, -3.7323136e-01, -3.7117685e-01, -3.6997713e-01,
      -3.6876994e-01, -3.6217897e-01, -3.5628537e-01, -3.5452331e-01,
      -3.5475572e-01, -3.5411088e-01, -3.5205640e-01, -3.5127657e-01,
      -3.4802984e-01, -3.4488812e-01, -3.4659772e-01, -3.4983694e-01,
      -3.5178646e-01, -3.5235633e-01, -3.5636037e-01, -3.5925467e-01,
      -3.6495331e-01, -3.6706033e-01, -3.7044205e-01, -3.7422113e-01,
      -3.7947738e-01, -3.8300904e-01, -3.8799535e-01, -3.8876017e-01,
      -3.7975479e-01, -3.7027706e-01, -3.6020695e-01, -3.6315375e-01,
      -3.5839988e-01, -3.6166912e-01, -3.5508569e-01, -3.5447828e-01,
      -3.5177893e-01, -3.5010686e-01, -3.4769992e-01, -3.4748246e-01,
      -3.4554794e-01, -3.4348595e-01, -3.4227119e-01, -3.3460054e-01,
      -3.3743488e-01, -3.4038167e-01, -3.4661268e-01, -3.4338096e-01,
      -3.4581789e-01, -3.4808983e-01, -3.5351107e-01, -3.5382597e-01,
      -3.5755260e-01, -3.5699023e-01, -3.6094928e-01, -3.6631051e-01,
      -3.7231657e-01, -3.6955723e-01, -3.6150413e-01, -3.5162150e-01,
      -3.4748248e-01, -3.4898963e-01, -3.5061676e-01, -3.4509055e-01,
      -3.4620029e-01, -3.4740750e-01, -3.4716754e-01, -3.4606531e-01,
      -3.4127396e-01, -3.4005925e-01, -3.3906198e-01, -3.3674504e-01,
      -3.3439806e-01, -3.2992912e-01, -3.3211863e-01, -3.2991416e-01,
      -3.3543285e-01, -3.3771229e-01, -3.3791474e-01, -3.3639261e-01,
      -3.3906200e-01, -3.3981930e-01, -3.4357591e-01, -3.4640275e-01,
      -3.4833729e-01, -3.5171899e-01, -3.5531062e-01, -3.5430588e-01,
      -3.4907210e-01, -3.3998426e-01, -3.3996928e-01, -3.3900949e-01,
      -3.3811724e-01, -3.3750986e-01, -3.3917444e-01, -3.4179131e-01,
      -3.4332096e-01, -3.4549545e-01, -3.3772729e-01, -3.3752484e-01,
      -3.3446559e-01, -3.3241856e-01, -3.2940428e-01, -3.2621003e-01,
      -3.2563268e-01, -3.2224350e-01, -3.2470290e-01, -3.2419302e-01,
      -3.2818956e-01, -3.2837703e-01, -3.2753721e-01, -3.2717732e-01,
      -3.3041653e-01, -3.3198366e-01, -3.3498296e-01, -3.3687250e-01,
      -3.3736738e-01, -3.3658008e-01, -3.3565030e-01, -3.3111387e-01,
      -3.3076145e-01, -3.2809958e-01, -3.2710980e-01, -3.2806960e-01,
      -3.3223859e-01, -3.3652756e-01, -3.4034416e-01, -3.4290104e-01 };
  const double factor[900] =
  { -6.7815958e-01, -6.0121626e-01, -3.2465632e-01, -3.4799029e-01,
      2.9416128e-01, 6.5249506e-01, -2.9595925e-01, 9.2242152e-02,
      3.9791491e-01, 1.2543987e-02, 3.4618899e-01, 7.1982378e-01, 6.2612320e-01,
      9.2059393e-01, 4.0947185e-01, 1.6408243e-01, 4.6688893e-01, 8.2781822e-01,
      1.5377159e+00, 7.0551350e-01, 2.3522265e-01, 1.1111490e-01,
      -7.6902137e-02, 4.8749890e-02, -1.9286089e-02, -6.9196904e-02,
      4.1760455e-02, 3.8850038e-01, 4.6103924e-01, 7.4886637e-01,
      -4.6383282e-01, -5.2266624e-01, -3.6656694e-01, -6.8517313e-01,
      2.0237543e-01, 4.8518588e-01, -1.7880508e-01, -3.4921574e-01,
      1.1801559e-01, 2.7596901e-01, 5.4967571e-01, 5.4305674e-01, 5.1035095e-02,
      9.1603304e-02, -3.7543187e-01, -2.3113842e-01, 1.9747150e-01,
      4.8476213e-01, 1.0192299e+00, 9.9642180e-01, 3.7445631e-01, 7.7422765e-01,
      4.8255847e-01, 1.4807837e-01, -4.6993604e-01, -3.0976173e-01,
      -2.5790455e-01, 2.6089970e-01, 3.2019846e-01, 8.3614978e-01,
      -9.1219492e-01, -7.6635299e-01, -7.6455366e-02, -2.1808711e-01,
      8.1110879e-01, -1.9624842e-01, -7.3375597e-01, -2.0263579e-01,
      1.2873220e-02, -8.9214524e-02, -3.3322625e-01, -5.2647250e-01,
      -9.9461035e-02, -4.3181704e-01, -7.3373125e-01, -4.8649281e-01,
      -2.1788719e-01, -5.0971698e-01, -3.2556615e-01, -4.9764651e-01,
      -5.0084982e-01, 1.7833718e-01, -1.0860602e-01, -9.1327425e-01,
      -1.0327271e+00, 3.8627782e-02, -1.9964302e-01, 5.3753202e-01,
      1.6736915e-01, 7.3638894e-01, 3.3908080e-01, 2.6112245e-01, 4.2360447e-01,
      -3.3761565e-01, -3.9181632e-01, -5.4973912e-01, -9.8514263e-01,
      1.2605073e-01, 6.3003112e-01, 1.8170850e-01, 1.3373801e-01,
      -4.2823896e-02, -1.8372083e-01, -4.0117612e-01, -7.9946538e-02,
      -1.7639672e-02, 6.2332885e-02, -2.0189504e-01, 1.0050513e-01,
      -1.4570712e-02, -6.5532218e-04, -9.0738052e-02, -6.4915917e-01,
      -1.1540433e+00, -1.0319837e+00, 6.4273719e-01, 2.6173702e-01,
      -3.6739940e-01, -5.0080940e-01, 2.5827783e-01, 5.8551890e-01,
      4.3190619e-01, 1.2813647e+00, 3.5282414e-01, 3.5105831e-01,
      -1.3579952e-01, 3.0213799e-02, 4.3487750e-01, 2.1299020e-01,
      -4.7002139e-01, -2.7129278e-01, -3.6395376e-01, -2.7771764e-01,
      -3.1688511e-02, 5.8469420e-01, 4.9673893e-01, 5.5227416e-01,
      -2.4460123e-01, -1.0826970e-01, -2.2288951e-01, -2.1121932e-01,
      -3.5338244e-01, -1.7200177e-01, 5.1626733e-02, 2.3049528e-01,
      4.3011170e-01, 4.7204632e-01, 1.5178076e-01, -1.1230389e+00,
      -8.6650722e-01, 2.7937930e-01, -2.1188040e-01, -2.0711948e-01,
      1.0813019e-01, 9.0562805e-01, 6.0082547e-01, 2.6771402e-02,
      -1.5066876e-01, -3.7920821e-01, -4.9076689e-01, -3.2606723e-01,
      -3.4690057e-01, -2.7717407e-01, -4.8979614e-01, -3.0311206e-01,
      3.6535474e-02, 1.4812321e-01, 3.4706823e-01, 2.4631023e-01, 3.4063486e-02,
      -1.0587172e-01, -2.0521876e-01, -4.1788823e-01, -2.3651836e-01,
      1.9127390e-01, 1.1479981e-01, -2.2665196e-01, 8.1092003e-01,
      3.1214121e-01, -9.4309517e-01, 7.0183745e-01, 6.0591072e-01,
      9.1814924e-01, 1.1834236e+00, 1.0946217e-01, 4.2873536e-01, 4.1069903e-01,
      -4.8703284e-02, -1.6763818e-01, -5.1716422e-01, -1.0617974e-01,
      -4.2418728e-02, -1.6797387e-01, -2.7894073e-01, -3.7472515e-01,
      -1.3826699e-01, -7.2110310e-02, 1.3535141e-01, 2.9405641e-01,
      4.1520674e-01, 1.1487791e-01, 1.1135335e-01, -1.4304634e-01,
      -1.5314277e-01, 1.1626979e-01, 6.9704260e-02, 1.7665616e-01,
      1.0087613e+00, 9.3090638e-01, 1.5673655e-02, -7.1233386e-01,
      -6.0817009e-01, -5.5360524e-01, 5.9729829e-01, 2.0077954e-01,
      -3.3234147e-02, -2.0730380e-01, -7.9351911e-01, -1.8066559e-01,
      -4.0732290e-01, -3.2119399e-01, -2.9668676e-01, -1.1082597e-01,
      -1.6427884e-01, -3.9690345e-01, -1.8522352e-01, -1.3208702e-01,
      -7.8315897e-02, -5.1089244e-02, 2.3469254e-01, -1.1302741e-03,
      -1.0883612e-01, -1.5303379e-01, -2.0318783e-01, 1.3323299e-01,
      -1.8578839e-01, -7.1018240e-02, 8.8664584e-01, 9.9911981e-01,
      3.8250996e-02, -1.2030737e+00, -1.6352676e+00, -7.9841800e-01,
      -6.5642447e-01, -2.8096493e-01, -3.7520461e-02, -9.6016666e-02,
      -7.7849325e-02, 1.5925655e-01, -4.0847401e-01, -3.4626462e-01,
      -3.6381655e-01, -1.6517793e-01, -7.8844904e-02, -1.7236139e-01,
      -1.8303128e-01, -1.0799026e-01, -3.1167776e-01, -2.4686715e-01,
      -1.0275794e-01, -1.7399150e-01, -2.0591375e-01, -4.0676366e-01,
      -3.0736757e-01, -2.2845024e-01, -4.1711813e-01, -3.0741249e-01,
      5.1180679e-02, -6.4274237e-01, -1.0937217e+00, -8.3263780e-01,
      -9.7183251e-01, -1.5466480e-01, -6.1940955e-01, 6.0536971e-01,
      1.6958446e-01, 4.2458722e-01, 8.8334878e-02, 3.8602859e-01, 4.6822075e-01,
      5.6422165e-01, 3.5733509e-02, 8.9869536e-02, -2.2700670e-01,
      9.8145150e-02, 1.0043222e-01, 1.2201458e-01, -4.0353388e-02,
      -3.3020428e-01, -1.3407968e-01, -3.0157408e-01, 1.1721465e-01,
      -3.9379677e-01, -1.4031418e-01, 1.7656558e-01, -2.7576796e-01,
      -7.4547841e-02, -3.6961025e-02, 2.4155309e-01, 5.5663631e-01,
      -6.7260697e-01, -3.3311174e-01, 6.5833923e-01, 5.4188919e-01,
      -1.2387340e-01, -1.2450089e-01, -2.2624691e-01, 1.3852712e-01,
      8.2628101e-01, 6.7498928e-01, 5.5255498e-01, 3.6626716e-01,
      -1.0433733e-01, -4.6502111e-01, -5.3804302e-01, -9.4579163e-02,
      -4.9103052e-02, -2.5262102e-01, -5.6987418e-01, -3.8207164e-01,
      -6.4110982e-01, -4.2102301e-01, -4.1504267e-01, -7.1166958e-01,
      2.5183362e-01, 3.4766070e-01, 6.4382269e-01, -1.5908935e-01,
      -2.5026423e-01, 2.8679041e-01, 7.5021687e-01, 4.3992998e-01,
      1.2276155e+00, 3.4527492e-01, 6.5299114e-02, 5.3119112e-02,
      -8.9357230e-02, -6.6548175e-02, 1.5708532e-01, 1.5335413e-01,
      -1.2445415e-01, -6.2301517e-02, -2.8998526e-01, -5.0528596e-01,
      -4.9060409e-01, -1.9552617e-01, -2.0643424e-01, -3.6177173e-01,
      -1.5897542e-01, -1.2908196e-01, -2.4949301e-01, 6.3638539e-02,
      -1.4001220e-01, -4.3105588e-01, -2.8595935e-03, 4.8451164e-01,
      6.7071740e-01, 8.6375646e-02, -8.8296140e-02, -8.0313109e-02,
      -3.1781531e-01, -7.6046339e-01, 2.2694522e-01, -7.1986354e-02,
      1.1067840e-01, -6.7437411e-01, -3.5408526e-01, -4.4944394e-01,
      -2.7022142e-01, -1.9719542e-01, -3.5192593e-01, -7.0659162e-02,
      -1.3470615e-01, -3.7344332e-01, -7.5707194e-02, -6.0945645e-02,
      -1.0311539e-01, -9.1409088e-03, 4.8470010e-03, -1.6052008e-02,
      -2.6575918e-01, 4.7692940e-02, -3.4434842e-01, -1.6118773e-01,
      3.1187485e-01, 3.7788777e-01, 2.1573140e-01, 1.6674856e-01,
      -3.7642440e-02, 3.0931095e-01, 1.8160049e-01, -3.2069454e-01,
      -2.5043583e-02, 5.6231845e-01, 5.7418340e-02, -1.7198387e-01,
      1.5648099e-02, -2.1736977e-01, -9.0413485e-02, -6.2201368e-02,
      3.1293336e-02, 4.1756999e-02, 1.0929921e-01, -3.6050933e-01,
      -1.4570557e-01, 4.9965165e-02, 4.7354672e-02, 1.9090173e-01,
      -3.9515162e-03, 9.1246586e-02, -4.2968929e-01, -4.4884424e-01,
      -3.3399772e-01, -9.1588895e-02, -6.8766390e-02, 2.6180875e-01,
      2.5485461e-01, 2.4281926e-01, 7.4413855e-02, 4.8471831e-01, 2.8442059e-01,
      -1.7789382e-01, 1.8885830e-01, 3.5416213e-01, -1.8096990e-01,
      -2.2943260e-01, 3.3018495e-01, -4.1849497e-02, -3.0155762e-01,
      2.7168125e-01, 3.3417076e-01, 2.3513174e-01, -7.4181450e-02,
      -3.4227038e-01, -2.9641001e-01, 1.1443475e-01, 2.1658572e-01,
      1.1852941e-01, 8.7699531e-02, 1.9174487e-02, -1.5959411e-01,
      3.9578112e-02, 3.2599769e-01, 1.8200253e-01, 4.5107202e-02, 3.4514364e-01,
      2.7183239e-01, -5.8939506e-02, -4.2422494e-01, 1.4136294e-01,
      4.2400175e-01, 1.4883187e-01, -1.2385516e-02, 4.9524165e-01,
      -3.7571678e-01, -1.3332417e-01, -4.3639040e-02, 6.6977923e-02,
      -3.2512796e-01, 2.1679737e-01, 3.6345672e-01, 9.8502255e-02,
      -1.5109258e-01, -3.5296011e-01, -2.7669413e-01, -3.5882975e-03,
      1.0282640e-01, 2.9575599e-01, -1.4569404e-01, -1.0865555e-02,
      -2.0191418e-01, -2.8125890e-01, -6.3351923e-02, 5.6467929e-02,
      5.6676600e-02, 5.3890577e-01, 1.4779218e-02, -4.2255505e-02,
      -4.5000017e-01, -6.2636118e-02, 3.6093572e-01, -9.9446742e-02,
      -4.4626869e-02, 5.2563932e-01, -3.6934166e-01, -1.0620163e-01,
      -1.6944717e-01, -1.8374348e-01, -3.7306836e-01, 1.3918758e-01,
      2.2153440e-01, 1.1231620e-01, -1.1248749e-01, -3.5476756e-01,
      -2.1633077e-01, -9.8891846e-03, 9.8501815e-02, 2.2722614e-01,
      -3.6089889e-01, -2.3558773e-01, -2.3314532e-01, -2.8029978e-01,
      -1.7944933e-01, 1.9713140e-02, -2.8156690e-02, 3.9694881e-01,
      -2.4356478e-02, -5.0522291e-02, -4.6482846e-01, -2.6836701e-02,
      1.1745042e+00, 8.8111789e-01, 3.5503922e-02, 2.1268383e-01, 1.1256023e-01,
      2.2252585e-01, -8.7408682e-02, 5.9292821e-02, 1.0843190e-01,
      -8.4405792e-02, 6.3098602e-02, 2.2985290e-01, 2.8103946e-01,
      -3.0146872e-02, 1.7468868e-01, -1.7078198e-01, -8.1891064e-02,
      -4.7257949e-02, -2.1790642e-01, -1.2615274e-01, -1.2263495e-01,
      -3.2592698e-01, -3.5970569e-02, 8.5704781e-02, -2.6483386e-02,
      2.3671276e-01, -1.6492552e-01, -1.9548932e-01, -4.1598763e-01,
      -1.2219010e-01, 3.4517718e-01, 1.5936237e-01, 1.4923832e-01,
      5.8884938e-02, 6.8994938e-02, -2.1583374e-01, -1.0949685e-01,
      5.3205632e-02, -3.4265569e-01, -2.4494403e-01, -2.6404286e-01,
      2.4573856e-01, 3.1455026e-01, 5.3635051e-01, 3.1074198e-01, 7.4516446e-02,
      1.6294599e-01, 4.8385777e-02, 3.4596217e-01, 1.7139316e-01, 1.4253879e-01,
      1.7616996e-02, 4.4110802e-01, 5.3266027e-01, 1.3061131e-01, 1.4354957e-01,
      1.2746054e-01, 2.4392930e-01, 4.0894461e-02, 3.4128156e-01, 8.9409003e-01,
      6.5484074e-01, -4.3166280e-01, -3.6077342e-01, -2.4026908e-01,
      -6.8484085e-03, -3.6156985e-01, 1.8697762e-01, 6.0525599e-02,
      -3.3485584e-01, -5.7715544e-02, 2.5500788e-01, 3.7189075e-02,
      5.0679642e-02, 1.7119851e-01, 3.7947907e-01, 2.6708788e-01,
      -1.2195700e-01, 6.3740121e-02, -1.5192348e-01, 1.2960377e-03,
      1.8657359e-02, 1.9633271e-01, 1.7927557e-01, -2.3741395e-01,
      -2.6903805e-01, -3.3135941e-01, -1.4344617e-01, -8.2839722e-01,
      -3.9893712e-01, 4.0367417e-01, 1.7945507e-01, -3.1624153e-01,
      -1.9251108e-01, -3.1043760e-01, -5.1135921e-01, -4.1599808e-01,
      -4.3073648e-02, 1.6322109e-01, 6.0910436e-03, -2.0886520e-01,
      2.5955871e-01, 1.9647420e-01, -8.4965401e-02, -9.6820936e-02,
      3.2317990e-01, 1.3124667e-01, -7.9126307e-02, 1.3996231e-01,
      1.0596750e-01, -1.4829375e-01, -1.2669287e-01, 2.7122464e-01,
      3.4704382e-01, -1.6084732e-01, -1.3615683e-01, -6.5218089e-02,
      -1.4991563e-01, -4.7918428e-01, -4.1981776e-01, 6.7026885e-01,
      4.1410982e-01, -2.6532574e-01, -5.3136711e-01, -1.6586800e-01,
      -5.1090658e-01, -3.9393189e-01, 1.4887979e-01, 6.4658271e-01,
      -1.6126938e-01, 1.4730637e-01, 5.3929808e-01, 7.5213472e-01,
      1.3529575e-01, 1.2454240e-01, 5.2921430e-01, 3.8226378e-01, 3.0003142e-01,
      1.7522442e-01, 2.0322522e-01, -9.8343001e-02, -3.3341775e-01,
      8.0123474e-02, 1.1335820e-01, -1.8476454e-01, -6.5645590e-02,
      1.4242868e-01, -2.1006411e-01, -4.2347571e-01, -6.6375931e-01,
      4.2209127e-01, 5.3300093e-01, -3.4613286e-01, -4.7229109e-01,
      -5.5035258e-01, -1.0568669e+00, -9.6860649e-01, 3.6923074e-01,
      2.4834736e-01, 3.7370392e-01, -7.4097908e-02, -1.3254621e-01,
      2.8950557e-01, -5.9876723e-02, 1.9354600e-01, -6.4903355e-02,
      -1.3120973e-01, -2.7919355e-01, -9.4324758e-02, -5.1129218e-02,
      1.1817684e-02, -1.5813388e-01, 2.4549711e-03, 6.7346341e-02,
      -2.2715818e-01, -1.1034719e-01, 1.7465594e-02, 3.9707183e-02,
      9.2119440e-02, 8.7713362e-02, 3.5467289e-01, 3.7318553e-01,
      -1.7345186e-01, -7.0118604e-02, 3.7018002e-01, -5.0359789e-02,
      -4.2859777e-01, 3.4317441e-01, -1.8142368e-01, -6.1753731e-02,
      -2.3528022e-01, -2.8726621e-01, 2.3722827e-01, -1.2742050e-01,
      4.1754479e-01, 1.5802124e-01, 1.1958617e-01, -4.3430260e-01,
      -1.1398394e-01, -5.8547126e-02, 3.8257689e-02, -3.4252592e-01,
      -2.8462685e-02, 7.2925409e-02, -2.7139985e-01, -1.3955433e-01,
      -2.7452937e-02, -1.4228763e-01, 5.5069830e-02, -6.0040497e-01,
      1.4166337e-02, 1.6652607e-01, -6.6368002e-02, 4.3514029e-02,
      4.7781977e-01, 7.1715463e-01, 6.0267117e-01, 3.2521181e-01, 5.2823712e-01,
      1.1748125e-01, 1.5085670e-02, 1.1356156e-01, 5.0137922e-01, 1.4415515e-01,
      -1.4274020e-01, -4.5851507e-01, -2.1513126e-01, -3.3936108e-01,
      -1.3277485e-01, -1.8888183e-01, -2.0787450e-01, -1.0380885e-01,
      1.4563964e-02, 2.0960731e-01, 2.4369505e-01, 2.8914521e-01, 4.8096830e-01,
      -9.3210585e-02, -5.9957996e-02, -3.0313573e-01, -1.3547963e+00,
      -1.3482142e+00, -9.2770152e-01, -5.6021547e-01, -1.0434388e-01,
      -5.1646642e-02, -4.1396809e-01, -4.0746971e-01, 1.7702049e-01,
      9.8535402e-01, 3.3700223e-01, -6.1206723e-01, 2.6259960e-01,
      -1.8563563e-01, 2.8091106e-01, 5.7268638e-02, -1.4696316e-01,
      -3.8678354e-01, 1.5381230e-01, -6.1033355e-02, -1.3229255e-01,
      2.7358471e-01, 6.8612053e-01, 5.4582478e-01, 1.3425472e-01, 2.0451344e-01,
      2.9245462e-01, -4.9330144e-02, 5.0898706e-02, 8.6278830e-02,
      -9.6413986e-02, -1.2207638e-01, -5.3523611e-01, -5.4962326e-01,
      -2.3203027e-01, -5.1629750e-01, 2.0579571e-01, -2.9688043e-01,
      -2.1178987e-01, 5.8068932e-01, 1.4536007e-01, -2.5755327e-01,
      3.0780464e-01, 4.2867139e-02, 2.9285605e-01, 3.5777924e-02,
      -1.1143349e-01, -2.6345629e-01, 9.9297171e-02, -1.0137726e-01,
      3.2381172e-01, 1.2315281e-01, 3.8359381e-01, 5.0972814e-01,
      -1.8713976e-01, -4.0464545e-01, -5.2099857e-02, 2.1865647e-01,
      -1.7606894e-01, -1.0269706e-01, 4.9753079e-03, 1.0178758e-01,
      -4.6111585e-01, -5.3711115e-01, -2.4591161e-01, 3.4820158e-01,
      -9.1719684e-02, 7.7153081e-03, -1.3042654e-01, 8.6490550e-02,
      -3.8889382e-01, -7.5542326e-01, -9.2017784e-02, -2.6480193e-02,
      2.3475137e-04, 1.9660157e-01, 2.2686161e-01, -7.9144790e-02,
      1.2401142e-01, 1.0163539e-01, 2.0284893e-01, 1.2681797e-01, 1.4121023e-01,
      4.4180853e-02, -6.1785815e-01, 2.4579470e-02, 5.5524665e-01,
      3.6807426e-01, -3.1648321e-01, -5.5489836e-01, -4.3502136e-02,
      2.5242646e-01, 2.1010264e-01, 2.8353375e-01, 3.9570606e-01, 6.1503129e-02,
      4.9542802e-02, 9.8567021e-01, 7.2175723e-01, 8.8887426e-01,
      -4.3238019e-01, -3.4394061e-01, 1.9737328e-01, 6.6859577e-01,
      3.0186501e-01, 5.7463603e-01, 5.9289423e-01, 2.5965051e-01, 4.7809166e-01,
      5.7124682e-01, -3.9709961e-02, 1.1580461e-01, 1.8202917e-01,
      9.7038161e-03, -7.8272181e-01, -2.1735676e-01, -9.1375206e-01,
      -8.4804456e-01, -3.4201673e-01, 1.8480229e-02, 1.1508475e+00,
      1.1023188e+00, 1.2207250e-01, -5.3009364e-01, 1.5473741e-01,
      -4.3103667e-01, -3.1285961e-01, 8.0524516e-01, 1.3588604e-01,
      4.5986565e-02, -6.8727414e-01, -9.8210401e-01, 3.7581419e-03,
      4.1733983e-02, -2.4718661e-02, 2.0116776e-01, 1.9345519e-01,
      2.1643440e-01, 5.9256292e-01, 5.9996062e-01, 2.3956677e-01, 3.8292829e-01,
      7.5742301e-01, 5.9286123e-01, 1.3512747e-01, -1.3199927e-01,
      -1.4343946e+00, -1.0227636e+00, -1.0720740e+00, -9.5678959e-02 };

  const double SVM_weights[2916] = {-0.522465, -0.100281, 0.211647, -0.484861, 0.035398, 0.120589, 0.476442, -0.269159, -0.282722, -0.186505, 0.108833, -0.139367, -0.518704, -0.131398, -0.073983, 0.041056, 0.025380, 0.520536, 0.084273, -0.380874, -0.160375, -0.595620, -0.360217, 0.392649, 0.459652, 0.190068, 0.392633, 0.042033, -0.122438, -0.003520, 0.216768, -0.016047, 0.135488, 0.254643, 0.185278, 0.342557, -0.201771, 0.013705, -0.070961, 0.111297, 0.066134, -0.339146, -0.310272, 0.060800, -0.511911, 0.126130, 0.090673, -0.209253, -0.292100, -0.202777, -0.531496, 0.030529, 0.181789, 0.034371, -0.481275, -0.127519, -0.170212, -0.381478, 0.669132, -0.214936, -0.556632, -0.043625, 0.290352, 0.553493, 0.024541, 0.338555, -0.094908, -0.091982, 0.348418, 0.418887, 0.397989, 0.210249, -0.042283, -0.027459, -0.164313, -0.398772, -0.065583, -0.420536, -0.206146, -0.151447, 0.333702, -0.198888, 0.134067, 0.306440, -0.118931, -0.455541, -0.263559, 0.105893, 0.143473, 0.464293, -0.291901, -0.141139, -0.342925, -0.518037, 0.245625, -0.411070, 0.065780, -0.390980, -0.116913, 0.029943, -0.256556, -0.304118, 0.182990, 0.042996, 0.327217, 0.592337, 0.801219, 0.716399, -0.313283, -0.034369, 0.133895, -0.144064, -0.869196, -0.398725, -0.313919, 0.098880, 0.614747, 0.259651, 0.434764, -0.041166, 0.037490, -0.363417, -0.462807, -0.196988, 0.000794, 0.683417, -0.265477, -0.174785, 0.058253, -0.150581, -0.426046, 0.186459, -0.079885, -0.133207, -0.342038, 0.901112, 0.221204, -0.167851, 0.087601, 0.328172, 0.184024, 0.478836, 0.234322, 0.379998, -0.136206, 0.032644, -0.096628, -0.168754, -1.035361, -0.299029, -0.208060, 0.049398, 0.593157, 0.240586, 0.126165, 0.317368, 0.097532, -0.021845, -0.364269, -0.523991, -0.243870, 0.560881, -0.227392, 0.151038, -0.232886, 0.005421, 0.191832, -0.170602, -0.858739, 0.070619, -0.055356, 0.095719, 0.058639, -0.061388, 0.065140, 0.599673, 0.110274, 0.577679, -0.178404, 0.117521, 0.149282, 0.023393, 0.040714, -0.064598, -0.472817, -0.348993, -0.447963, 0.014916, 0.157887, -0.159084, 0.145775, -0.004044, -0.121629, 0.588962, 0.012375, -0.389998, -0.081640, 0.101419, 0.076468, -0.191867, -0.006583, 0.378191, 0.233137, 0.157521, -0.243696, 0.025520, 0.403741, 0.303383, 0.090268, -0.003688, 0.353058, -0.014971, -0.287107, -0.011041, -0.556880, -0.319002, -0.036928, 0.127223, -0.106410, -0.150980, -0.628602, -0.338747, -0.662305, -0.365687, -0.080968, 0.081783, -0.163206, -0.108469, 0.353305, 0.054037, -0.073288, -0.171688, -0.520270, 0.580211, -0.079440, -0.316066, 0.451826, 0.373428, 0.041797, -0.286523, 0.191195, 0.187137, 0.221896, -0.484599, -0.108936, 0.115326, -0.344436, -0.181383, 0.445383, -0.100524, 0.166416, -0.147920, -0.035462, -0.304673, -0.031957, -0.054493, -0.378223, -0.245965, -0.114896, -0.682532, -0.228278, 0.230686, 0.084047, -0.448901, -0.377916, 0.481223, 0.005309, 0.083348, -0.345901, 0.067666, 0.609063, 0.557184, 0.328010, -0.030774, 0.111519, -0.169129, 0.293514, -0.336026, 0.305400, 0.020709, 0.138188, -0.153504, 0.242097, 0.120405, 0.514658, 0.202202, 0.157052, 0.208830, -0.069046, -0.055303, -0.122011, -0.355383, -0.379536, -0.448029, 0.098002, -0.670662, 0.259685, -0.129356, -0.076215, 0.068569, -0.309679, 0.191366, 0.025704, -0.046294, -0.523146, -0.152830, -0.120872, 0.000294, 0.064614, 0.291566, 0.387193, 0.008754, -0.039402, 0.119423, 0.709227, 0.029239, 0.314700, 0.110741, -0.060183, -0.425410, 0.031273, 0.170522, -0.272122, 0.464103, -0.101172, -0.063688, -0.038423, -0.284358, -0.361700, 0.393473, 0.129563, -0.269014, -0.623218, -0.091717, -0.742617, -0.441229, -0.187166, 0.212030, -0.280691, 0.106200, -0.748252, 0.283236, 0.295919, 0.277668, 0.560148, -0.147879, 0.146755, -0.242145, 0.093109, 0.021561, 0.340798, -0.515063, -0.037092, 0.214450, -0.335782, 0.684814, -0.287235, 0.107875, 0.160235, 0.441616, 0.410222, -0.089853, -0.038924, -0.228897, 0.189194, -0.056906, -0.106489, -0.086902, -0.337359, -0.015103, 0.011966, 0.244044, -0.150426, -0.186776, 0.205865, 0.082512, 0.138594, -0.081254, 0.340497, -0.029161, 0.292044, -0.274927, 0.198231, -0.281536, -0.036290, -0.061948, -0.277758, -0.273912, -0.216439, 0.010446, -0.114098, -0.075591, -0.153601, 0.378997, 0.111373, 0.545416, -0.017165, -0.124185, -0.102969, -0.244093, 0.113299, -0.149854, -0.384281, -0.094497, -0.175620, 0.089071, -0.257860, -0.407768, 0.444249, 0.609111, 0.006518, 0.569501, 0.014909, -0.326592, -0.830696, -0.235418, 0.177032, -0.342182, -0.246151, -0.306157, -0.019687, -0.466898, -0.583411, 0.008825, 0.060888, -0.254364, 0.060494, 0.784190, 0.417396, 0.693102, 0.444870, 0.251118, -0.461645, -0.184866, -0.039839, 0.074940, -0.211336, 0.019656, -0.262674, -0.121151, 0.284493, -0.172627, 0.083797, -0.021204, 0.191083, 0.071454, -0.180286, 0.648304, -0.122100, -0.326541, -0.469136, 0.237574, -0.094296, 0.166968, -0.457413, 0.332400, -0.098006, -0.108217, -0.641666, -0.306754, 0.074091, 0.093156, 0.213133, 0.312169, 0.266836, 0.245528, 0.018107, 0.007394, -0.424565, 0.380155, -0.098578, 0.031388, -0.595987, -0.204023, 0.078388, 0.068362, 0.169638, -0.340364, 0.320505, 0.395750, -0.131147, -0.287923, 0.087827, -0.300573, 0.522290, 0.435947, -0.060475, -0.090075, -0.140381, -0.013627, -0.224914, 0.409035, -0.004194, -0.541230, -0.173031, 0.034558, 0.025276, -0.005435, 0.256197, -0.076531, 0.068939, -0.126929, 0.021228, 0.159011, 0.455703, -0.136740, 0.197226, -0.096779, -0.186826, 0.268938, -0.038176, -0.054388, -0.489032, 0.227645, 0.003189, 0.066508, -0.017198, 0.184297, -0.053660, -0.072622, 0.123946, -0.194471, 0.136650, -0.156446, 0.096322, 0.092810, 0.295948, 0.325985, 0.217989, -0.557262, 0.159935, 0.161742, 0.179072, 0.099333, -0.202158, -0.137476, -0.075298, -0.212388, -0.322197, -0.126423, 0.098894, -0.014597, 0.112396, 0.299711, -0.105979, 0.240710, -0.278772, -0.006611, 0.050193, 0.357763, 0.106807, -0.018439, 0.205789, -0.036624, 0.397994, -0.026165, 0.430990, -0.703651, 0.476109, 0.124521, 0.071775, -0.155574, 0.415941, 0.511888, -0.134899, -0.372638, 0.003129, 0.219357, 0.046649, -0.239327, -0.033862, 0.004829, -0.036069, -0.488099, -0.525412, -0.464727, -0.067663, 0.170164, -0.037829, 0.147285, 0.005760, 0.234164, -0.204327, 0.295322, 0.226148, 0.245269, 0.380058, -0.012354, 0.172905, -0.221232, -0.059960, 0.268815, 0.455677, -0.542388, 0.003821, 0.226626, 0.007329, 0.175819, -0.125456, -0.064169, 0.225205, 0.106736, 0.169169, -0.555727, 0.220568, -0.095624, -0.100253, -0.139177, 0.080216, -0.496020, -0.400977, 0.186028, -0.072256, 0.444608, -0.012196, 0.049943, -0.079176, -0.148916, -0.098385, -0.373691, -0.295938, -0.246426, 0.097045, -0.209878, -0.086383, 0.456224, 0.064546, 0.149893, -0.021617, -0.881958, 0.346635, 0.256609, 0.173395, -0.169662, 0.627238, -0.003033, 0.368730, 0.076827, -0.107276, 0.243427, 0.143512, 0.212838, 0.204575, -0.152118, -0.429400, -0.239548, -0.845970, 0.235782, -0.570912, -0.098786, -0.213330, -0.187874, 0.284746, -0.284307, -0.001084, -0.109054, 0.322113, 0.552857, -0.315609, 0.073992, -0.448548, 0.197328, -0.534404, -0.702587, -0.343985, -0.434534, 0.316481, 0.722000, 0.288254, 0.521590, 0.482308, -0.114769, 0.469921, 0.434390, 0.130792, -0.286173, 0.127842, -0.139112, 0.283894, -0.105179, 0.184355, -0.633883, -0.296833, 0.208973, 0.133315, -0.080133, 0.271364, -0.338024, -0.175706, -0.098506, -0.026441, -0.550285, -0.283177, -0.626018, 0.091078, -0.431198, -0.250251, -0.045888, 0.636397, -0.109829, -0.139258, -0.459945, -0.380668, -0.159522, 0.052982, 0.510677, 0.245311, 0.212133, -0.154926, -0.103105, 0.065827, -0.280275, -0.080976, -0.062037, 0.093395, 0.289169, -0.107931, 0.163352, 0.199967, 0.002059, 0.973586, -0.037025, -0.004879, -0.469406, 0.299635, 0.360473, 0.077159, -0.094900, -0.183360, -0.193551, -0.224514, -0.565923, -0.294304, -0.294952, 0.386104, 0.412306, 0.263814, 0.232636, -0.308557, 0.162847, 0.088215, 0.087842, 0.022664, 0.063360, 0.158407, -0.181286, 0.095020, -0.405953, -0.384147, -0.374562, 0.070554, 0.026133, 0.029381, -0.232301, 0.190777, 0.418067, -0.403914, -0.180502, -0.148372, -0.105995, 0.359775, 0.746653, 0.299191, -0.245803, -0.694403, -0.366032, 0.181868, 0.167377, 0.073866, 0.210316, 0.390534, 0.979296, 0.354597, 0.345509, -0.459521, -0.212505, -0.524000, 0.182011, -0.130784, -0.472591, 0.282639, -0.216247, -0.418173, 0.144524, -0.271726, -0.213665, -0.047901, -0.409153, 0.189722, 0.176552, 0.028158, -0.290256, 0.336142, 0.313141, 0.113985, -0.003250, -0.584225, 0.114839, -0.696047, -0.226569, -0.302559, 0.233082, -0.092647, -0.219102, 0.378843, -0.465657, 0.355992, 0.150811, 0.416597, -0.019524, 0.477204, -0.012084, 0.102163, 0.012057, -0.060500, 0.003367, -0.092172, -0.198500, -0.646509, -0.265838, -0.082853, 0.172518, -0.167182, -0.012874, 0.096639, -0.470522, 0.033557, 0.369006, -0.360130, 0.050126, -0.120854, 0.185462, 0.021223, -0.431463, -0.077552, 0.210898, -0.310726, 0.203288, 0.041214, 0.036492, -0.596012, 0.117535, 0.022678, 0.395495, 0.646088, -0.265066, -0.246124, -0.076285, 0.259417, -0.378649, -0.178969, -0.249447, 0.170410, 0.127619, -0.258320, 0.238197, 0.290989, 0.349274, 0.384145, -0.149598, 0.006853, -0.172222, -0.239137, 0.246639, -0.008554, 0.221696, -0.260628, -0.218317, -0.169479, 0.048175, 0.029689, -0.103572, 0.113767, 0.390696, 0.007788, -0.128100, -0.076773, -0.172434, 0.194394, 0.275916, 0.059443, 0.219786, -0.098264, 0.250335, 0.121064, 0.363599, 0.085231, 0.116641, -0.242888, -0.130401, -0.042541, 0.250366, 0.325285, 0.190413, 0.002051, -0.020376, -0.497240, -0.568947, -0.357063, 0.125359, -0.450294, 0.074336, 0.026401, -0.185076, -0.148445, -0.236239, 0.511095, -0.461744, 0.196888, 0.267039, 0.174798, 0.218179, -0.130257, -0.321391, 0.336866, -0.127428, -0.068779, 0.054590, 0.473245, 0.463441, 0.090066, 0.284765, -0.230231, 0.287224, 0.789219, -0.337080, -0.129909, -0.162563, 0.288773, 0.324237, -0.059951, -0.303926, -0.134304, -0.313352, -0.481800, 0.111749, -0.255725, -0.179234, -0.024511, -0.164273, -0.545727, -0.337244, 0.128713, 0.188256, -0.148374, 0.446552, 0.180048, -0.056327, 0.171813, 0.083207, -0.462902, 0.195266, -0.459269, -0.406559, -0.098931, 0.457776, 0.229388, -0.516240, 0.730247, -0.094355, 0.189092, -0.000136, -0.137112, 0.038514, 0.564368, 0.174930, 0.292829, -0.411333, -0.356467, -0.151817, 0.055492, 0.363565, -0.595737, 0.066561, -0.288060, 0.019750, -0.002657, -0.277397, 0.022503, 0.049278, -0.161434, 0.789810, -0.310348, -0.313134, 0.013399, -0.204121, -0.329120, 0.273007, 0.272815, -0.404828, 0.026299, 0.448266, 0.169383, -0.054190, 0.393536, 0.085024, -0.029170, 0.151260, -0.663228, 0.301186, -0.277694, 0.056409, 0.124219, -0.422893, -0.017938, -0.195199, 0.083785, -0.066539, -0.556143, 0.003652, -0.241212, 0.180243, -0.052270, -0.204961, 0.245802, 0.112196, 0.074946, -0.220650, 0.037607, -0.030091, -0.044950, -0.056341, -0.083484, 0.261651, -0.070501, 0.030720, -0.329807, -0.175337, 0.270858, 0.147018, 0.213602, 0.167713, 0.028650, -0.082460, -0.030254, 0.046258, 0.113372, 0.229498, 0.162512, 0.288189, 0.172340, -0.362689, -0.314108, -0.373672, -0.103204, 0.111678, 0.008264, 0.015877, -0.376265, -0.111092, -0.308758, -0.389913, 0.021304, -0.134617, -0.060056, -0.060232, 0.162743, -0.066855, -0.014086, -0.537666, -0.199486, -0.227418, -0.111556, 0.390227, 0.101309, 0.068096, 0.316123, 0.589221, 0.466187, -0.654215, -0.064314, -0.142406, -0.289992, 0.047700, 0.460838, 0.105259, 0.076185, -0.083537, 0.308337, 0.496547, 0.126845, -0.215663, -0.098216, 0.157383, -0.050766, -0.317643, 1.075344, -0.342603, -0.581897, -0.111832, -0.132820, -0.090704, 0.314972, 0.260139, 0.482247, 0.363840, -0.124291, -0.463575, 0.278480, -0.166915, -0.292399, 0.340033, 0.637278, -0.144686, -0.364049, -0.365754, -0.129324, -0.115732, 0.191270, -0.111992, 0.414098, -0.100016, -0.287136, 0.468842, -0.088901, 0.369412, 0.354931, -0.133805, -0.237194, 0.029017, -0.096483, 0.346237, -0.221002, -0.023495, -0.317554, 0.987572, 0.170376, 0.529816, -0.361275, 0.346229, 0.484729, 0.018784, 0.421673, 0.049182, -0.244029, 0.078815, 0.301731, 0.287616, 0.007653, -0.311405, -0.057375, -0.043550, -0.196662, -0.378413, -0.097504, -0.105837, -0.068500, -0.325413, 0.529472, -0.442434, -0.504463, -0.361081, -0.399188, -0.284507, 0.301556, -0.076954, -0.584530, -0.281886, 0.484488, -0.070181, 0.641890, 0.113909, 0.297846, 0.005424, -0.016708, -0.470831, 0.456956, -0.100097, 0.365732, 0.616048, -0.332913, 0.499985, 0.255268, -0.044578, -0.220040, -0.016741, -0.103939, -0.365608, -0.568549, -0.090323, -0.029850, 0.179483, 0.181533, -0.481903, 0.163713, -0.912826, -0.095973, 0.342171, -0.144912, 0.211227, 0.236566, 0.407034, -0.218058, -0.040466, 0.282436, -0.134575, -0.453605, 0.680466, -0.059230, 0.445736, -0.438569, 0.226253, -0.021933, 0.007568, 0.090788, -0.088438, -0.093295, -0.146246, 0.076452, -0.085852, 0.067555, -0.170866, -0.515540, -0.055430, -0.839740, 0.590113, -0.011337, 0.187334, 0.039749, -0.041716, -0.136152, -0.258821, -0.254354, -0.000361, -0.709519, 0.053564, 0.011397, 0.079471, -0.136259, 0.166756, 0.488037, 0.022355, -0.004054, 0.735397, -0.289354, 0.231313, -0.202189, -0.024031, 0.041290, 0.244615, 0.247431, 0.122628, -0.150161, -0.236543, 0.200229, 0.257175, 0.205615, 0.258457, -0.162789, -0.681167, -0.560809, 0.114476, 0.179131, -0.030698, -0.165159, 0.049994, -0.276198, -0.216435, -0.008463, -0.414026, -0.522564, 0.030379, 0.107293, -0.216815, 0.005061, 0.199915, -0.188378, -0.259578, -0.433151, -0.000364, 0.063898, -0.060202, -0.132866, -0.073966, 0.680586, 0.147532, -0.085727, 0.349445, -0.403599, 0.219355, 0.043975, -0.029641, -0.124116, 0.193201, 0.622912, 0.256384, -0.086874, 0.625867, 0.139672, -0.099080, -0.013065, -0.424393, -0.301351, -0.326593, -0.251419, -0.173091, -0.325283, 0.147747, -0.005887, -0.079006, 0.479766, 0.313765, 0.562690, -0.317540, -0.297212, 0.297933, -0.100699, 0.865318, -0.171906, -0.270965, -0.096859, -0.517456, 0.085721, -0.439703, 0.116577, 0.031644, 0.128727, 0.228061, 0.068574, 0.141323, -0.090049, -0.316339, -0.619782, -0.038119, 0.367173, -0.160626, 0.020402, -0.300212, -0.112039, 0.167992, -0.278655, -0.079251, -0.048507, -0.231769, 0.487131, -0.274208, -0.255966, -0.416207, 0.221957, -0.047233, 0.473240, -0.183551, 0.277516, 0.168616, 0.048008, -0.028743, -0.065660, 0.269866, 0.204562, -0.086793, -0.211211, 0.120792, 0.103273, 0.310245, -0.256599, -0.031170, 0.894266, -0.159231, -0.218505, -0.350436, -0.056149, 0.455456, 0.200243, -0.193835, -0.050350, -0.541777, -0.401028, -0.789422, -0.525016, -0.062281, 0.222344, 0.018366, -0.084723, -0.125128, 0.167191, 0.120619, -0.139521, -0.101725, -0.325617, -0.155546, 0.106234, 0.300252, -0.259711, 0.218028, 0.090411, -0.177359, -0.116518, 0.318061, 0.227549, -0.088918, 0.041113, -0.150538, 0.414406, 0.036569, -0.548753, -0.191320, -0.091226, 0.093606, 0.199543, 0.061767, 0.000475, -0.121064, -0.942982, -0.116912, -0.135664, -0.325455, -0.156913, -0.016801, -0.056286, 0.052791, 0.014399, 0.016700, -0.254825, -0.149386, 0.051274, -0.250288, 0.442059, -0.038538, -0.123656, 0.118264, -0.351603, -0.440755, 0.618544, 0.394214, 0.386938, 0.230791, 0.256031, 0.218606, -0.083346, -0.183584, -1.222079, 0.304435, -0.408805, 0.234244, 0.171572, -0.314068, -0.116379, -0.029410, -0.145096, -0.239323, 0.684590, 0.043404, 0.055422, 0.319867, 0.434784, 0.042540, -0.362493, -0.285629, -0.170780, 0.128015, 0.245349, -0.039557, -0.416409, 0.326867, 0.270530, 0.547924, 0.553991, -0.173560, -0.328935, -0.462789, 0.103172, 0.064127, -0.140639, 0.008347, -0.032607, -0.022020, 0.266738, -0.353695, -0.494457, -0.255995, -0.152258, -0.427986, -0.324777, -0.212945, -0.147371, -0.037288, 0.431970, 0.417454, 0.031176, 0.037135, 0.150363, 0.023955, -0.062089, 0.059787, -0.651474, -0.199300, 0.283136, 0.201577, -0.066321, 0.155015, -0.174228, 0.844599, 0.060711, 0.000443, -0.235193, -0.184713, -0.216659, -0.213580, -0.036004, 0.007570, -0.122351, -0.308590, -0.219871, 0.017356, 0.342923, 0.034054, 0.036976, 0.111678, -0.293631, -0.435288, -0.232936, -0.149375, 0.234961, 0.160750, 0.186970, -0.000572, -0.031065, 0.328536, 0.170990, -0.277139, 0.103906, 0.405078, 0.572145, -0.282916, 0.078491, -0.622333, -0.356341, 0.244883, 0.123851, -0.046008, 0.111670, -0.122149, 0.097834, -0.030945, -0.023496, -0.498939, -0.112712, -0.189296, -0.103527, 0.189399, 0.105643, 0.155934, 0.177926, -0.723584, 0.000649, -0.151971, -0.209860, 0.057023, -0.425473, 0.403306, 0.277466, -0.057848, 0.139615, 0.318511, -0.145637, 0.181427, -0.109151, 0.265130, 0.125066, -0.010597, -0.325837, -0.209450, -0.298679, -0.225073, -0.268698, 0.159644, -0.027843, 0.049797, 0.410150, 0.440009, -0.422445, 0.227224, -0.053340, -0.166745, -0.102884, 0.108586, 0.147309, -0.259260, 0.438378, 0.022367, -0.127350, -0.516838, -0.292099, -0.629595, -0.117338, -0.112709, -0.027570, -0.205730, -0.129726, 0.093999, 0.164149, 0.217261, 0.006414, 0.006553, 0.039575, -0.276159, -0.041290, -0.325520, -0.232239, 0.274645, 0.348423, 0.227152, 0.167930, 0.333699, -0.033927, 0.643923, -0.735552, 0.143077, 0.082053, -0.501619, -0.458067, 0.126526, 0.471200, 0.122764, -0.018412, -0.089147, -0.398817, -0.343145, -0.325052, 0.704539, -0.384604, -0.119846, -0.225749, 0.019217, 0.615830, -0.251702, 0.399907, -0.439210, -0.596159, 0.176167, 0.117348, -0.401994, 0.070242, 0.379602, 0.100453, 0.046282, 0.442352, -0.127424, 0.448876, 0.068176, 0.443489, -0.081579, -0.128174, 0.654093, 0.017330, 0.074263, -0.501402, 0.686176, 0.097934, -0.191536, 0.081396, -0.527295, -0.143605, -0.378932, -0.340894, 0.191863, -0.032882, 0.277348, 0.399139, 0.115412, 0.369591, 0.011206, 0.049945, 0.045933, 0.090510, 0.319257, -0.354146, -0.223610, -0.062274, -0.339689, -0.087752, -0.248608, 0.407904, 0.322215, -0.373987, 0.605604, 0.002397, 0.336939, 0.159875, 0.089378, 0.101650, -0.417997, -0.367694, 0.214473, 0.014155, 0.181419, 0.131161, -0.412122, -0.235086, -0.301594, -0.382701, -0.492986, 0.116842, -0.349290, 0.101787, 0.307951, -0.123667, 0.033513, 0.233319, 0.379353, 0.531279, 0.335978, -0.258080, 0.124260, 0.264155, 0.378016, 0.062327, -0.407401, 0.106544, -0.007256, 0.162879, -0.366703, 0.112553, 0.072867, -0.251048, -0.337419, 0.058542, -0.165068, -0.732997, 0.272985, -0.250592, 0.199184, 0.089820, -0.194772, -0.134703, -0.467650, -0.299747, 0.089316, -0.255411, 0.168253, 0.289776, -0.177252, -0.792535, -0.314721, -0.065117, 0.214048, -0.418392, 0.208592, -0.408042, -0.183607, 0.304257, 0.147089, 0.087185, -0.383016, 0.497336, 0.112068, 0.300556, 0.256509, 0.312583, 0.485738, 0.158638, 0.452605, 0.151372, -0.166319, -0.481290, -0.326942, 0.271365, -0.156254, 0.282889, -0.365583, 0.102618, -0.535158, -0.461980, -0.215463, -0.588827, -0.466370, 0.130762, 0.071108, 0.408600, 0.084378, 0.099847, 0.574552, 0.045672, 0.160135, -0.555311, -0.339460, -0.021191, -0.197421, 0.125230, 0.354629, -0.341141, -0.090309, 0.091881, 0.115681, 0.242173, 0.093094, -0.354124, -0.137743, -0.306244, -0.029738, -0.306747, 0.567757, 0.141755, -0.116315, 0.014973, 0.658018, 0.022966, 0.125460, -0.448632, 0.482344, -0.002599, -0.256629, -0.103575, 0.212426, 1.290315, -0.080873, -0.092750, 0.061073, -0.417594, 0.141624, 0.274328, 0.002524, -0.060895, 0.109330, -0.147647, 0.400027, 0.135330, -0.090359, -0.776160, 0.052031, 0.019797, -0.237656, -0.465871, -0.098177, -0.106972, -0.203148, 0.103463, -0.104762, 0.023006, -0.146381, 0.097103, -0.300498, 0.050859, 0.324079, -0.254031, 0.087465, -0.393391, 0.195960, 0.096478, -0.151237, -0.121419, -0.032065, 0.396796, 0.153199, -0.338830, -0.466361, 0.170068, 0.028403, -0.012772, 0.148599, -0.150938, 0.305591, 0.239308, -0.242573, -0.284480, -0.236940, -0.173637, 0.352187, 0.360058, 0.035862, 0.307603, 0.277970, -0.570114, -0.529803, 0.057883, -0.309513, 0.556816, -0.454878, -0.400134, 0.115479, -0.018059, -0.196745, -0.260830, 0.216122, 0.098917, 0.119024, 0.365297, 0.216357, 0.158142, 0.476211, -0.009907, -0.025450, 0.312271, -0.455311, 0.288646, 0.410152, 0.165884, -0.120591, 0.023683, 0.144741, -0.071757, 0.125792, -0.293513, -0.082844, -0.273868, 0.516669, 0.185242, 0.063103, 0.150507, -0.109497, -0.119255, -0.377379, -0.051965, -0.608765, -0.220715, -0.040044, -0.538715, -0.646470, -0.466616, -0.183576, -0.140862, 0.173940, 0.306614, 0.329953, 0.338735, -0.278641, -0.398057, -0.014734, 0.367154, -0.256563, 0.166842, 0.026995, -0.504618, 0.479961, 0.101881, -0.012080, 0.153138, -0.021055, -0.718250, 0.187287, 0.399352, 0.386637, -0.200756, -0.319360, -0.372523, 0.050726, 0.381381, 0.567447, 0.069979, -0.217064, -0.030156, -0.138137, 0.046158, -0.375948, -0.620234, -0.097153, 0.011838, -0.105359, -0.002957, 0.140342, 0.346980, -0.106943, -0.112129, 0.154471, 0.097587, 0.047431, 0.110010, 0.070915, 0.025149, 0.373712, 0.333956, 0.196861, 0.306419, 0.037213, 0.727090, 0.197102, 0.007729, 0.431674, 0.031712, -0.427560, -0.568266, 0.046243, 0.376189, -0.220622, -0.212245, -0.450929, -0.191961, -0.297512, -0.305009, 0.053187, -0.286613, 0.130917, -0.141974, -0.188606, 0.323330, 0.178560, 0.156434, 0.092020, -0.275383, 0.356959, -0.204844, 0.341583, 0.021394, -0.403572, 0.297130, -0.131979, 0.088913, 0.632747, -0.146153, 0.370213, 0.236877, -0.118614, 0.032064, 0.290220, 0.347649, -0.162731, -0.278876, 0.003900, 0.130326, 0.004745, -0.228238, -0.162680, -0.533526, -0.340007, 0.124875, -0.122840, -0.139925, -0.245453, -0.018578, -0.073110, 0.504092, 0.034710, 0.207654, 0.369117, -0.330208, 0.237395, -0.056651, 0.032683, -0.404938, -0.181505, 0.124932, 0.235833, 0.296943, 0.078692, -0.207871, 0.494069, 0.118383, 0.087435, 0.294542, 0.021547, 0.001701, 0.220999, -0.467478, 0.074425, 0.169241, 0.265583, 0.049412, -0.397141, -0.054745, -0.307870, -0.546054, -0.088253, -0.481987, -0.013995, -0.022990, -0.256973, -0.033365, 0.133333, 0.166063, -0.074656, -0.589580, 0.237231, 0.335580, 0.117004, -0.040622, -0.041228, 0.120143, -0.128206, 0.244618, -0.071621, -0.005170, 0.314936, 0.496785, 0.322647, 0.262770, 0.372953, 0.197406, -0.428669, -0.729722, -0.271032, -0.028011, 0.229223, -0.105067, -0.586468, -0.067850, -0.294522, -0.164392, -0.415890, -0.279281, -0.135177, 0.153527, -0.023315, 0.432284, -0.001588, 0.416817, 0.396034, -0.396917, -0.384568, -0.061561, -0.114911, 0.381467, -0.022421, 0.345283, 0.192476, 0.619600, -0.171573, 0.138612, 0.113910, -0.086990, -0.308573, -0.033489, 0.245102, -0.205095, -0.274631, -0.209518, -0.370900, 0.182100, 0.232829, 0.008934, 0.262126, -0.226814, -0.508907, 0.140236, -0.344685, 0.401059, -0.146007, 0.113664, -0.076553, -0.527596, 0.040042, 0.520820, 0.052530, 0.214796, -0.081729, 0.275628, -0.162775, -0.081677, -0.215646, -0.376310, -0.112934, -0.232287, -0.393317, -0.033152, 0.083074, -0.047732, 0.391926, -0.177381, 0.208096, 0.417398, 0.058737, -0.613204, 0.279865, -0.161927, -0.286955, 0.074132, 0.313002, 0.159884, 0.237254, -0.146718, 0.118354, 0.241118, 0.057572, 0.167736, 0.556642, 0.526423, -0.413427, -0.071655, 0.080328, 0.373547, 0.207098, 0.175353, -0.226938, 0.347727, 0.593639, 0.075505, 0.030503, 0.085161, -0.025030, -0.325538, -0.555178, -0.387274, 0.019421, -0.496476, -0.417316, -0.533036, -0.276930, 0.035719, -0.106184, 0.074106, -0.085129, -0.296197, 0.101531, -0.410759, -0.217237, 0.453046, -0.164483, -0.180960, -0.059450, -0.022679, 0.313842, 0.246927, 0.123615, -0.395331, -0.498928, 0.187847, 0.119849, -0.111855, -0.478758, -0.158028, 0.061143, -0.040323, 0.306550, 0.112105, 0.219789, -0.429251, -0.112349, -0.068538, 0.005860, -0.250577, -0.450688, 0.226377, 0.071577, -0.007626, -0.139633, 0.215691, -0.106397, -0.123076, -0.358895, -0.311265, -0.038725, -0.007948, 0.336087, -0.016291, 0.133878, -0.424592, -0.097122, 0.390414, -0.024204, 0.313589, -0.269159, 0.105571, 0.048560, 0.558229, 0.352161, -0.136038, -0.109471, -0.146382, -0.129748, 0.024363, -0.003057, 0.311930, -0.089422, -0.272936, -0.081584, 0.117091, 0.212776, 0.485201, 0.045358, -0.099139, -0.563765, 0.128128, -0.020398, -0.166541, -0.702338, -0.500133, -0.234866, -0.055809, -0.051071, -1.201572, 0.374834, 0.441749, 0.131451, 0.104922, -0.128608, 0.237113, -0.085284, -0.491845, 0.311098, 0.617030, -0.199382, -0.085723, -0.401969, 0.038738, 0.451079, 0.423601, -0.026888, 0.078397, -0.527082, -0.002209, -0.126615, -0.169957, 0.266570, 0.121565, -0.045431, -0.043473, 0.048933, 0.002376, -0.313848, 0.027047, -0.175901, -0.079308, -0.151124, -0.217876, -0.271375, -0.214524, -0.115415, -0.311532, -0.338494, 0.303532, -0.140043, 0.505672, -0.096280, -0.011379, 0.209129, 0.128022, -0.100683, -0.350789, 0.387216, -0.256836, -0.125863, -0.010172, 0.347030, 0.209518, -0.173441, -0.612618, 0.266772, 0.207664, 0.227575, 0.281323, -0.043002, 0.389995, 0.292073, -0.032012, 0.153673, 0.035288, -0.376379, -0.281467, -0.633560, -0.614321, -0.350304, -0.425963, -0.174895, -0.069832, -0.371838, -0.023268, -0.263675, -0.261584, -0.197519, -0.839714, 0.422563, -0.120916, 0.020424, -0.182732, -0.458378, 0.132560, 0.276191, 0.480633, 0.665245, 0.139062, 0.543046, 0.472283, 0.130432, 0.035468, 0.093843, 0.155185, -0.099895, -0.331099, 0.184514, 0.250042, 0.018744, -0.083593, -0.194245, -0.126454, -0.128040, -0.358340, -0.377212, -0.133198, 0.288271, 0.156750, -0.117138, 0.319593, 0.045372, 0.084051, -0.023251, -0.313009, -0.177127, 0.312750, 0.152389, -0.279978, 0.041729, -0.188761, 0.212224, 0.634803, 0.415149, 0.067003, 0.155591, 0.096058, 0.404210, 0.299909, 0.077383, -0.331458, -0.290752, -0.573099, 0.126607, 0.116670, -0.444375, -0.233576, -0.400542, -0.032388, -0.153957, -0.158641, -0.168946, 0.088906, 0.239807, 0.083895, -0.205655, 0.489965, 0.125623, 0.032885, -0.159213, -0.325476, -0.011315, 0.112357, 0.140063, -0.278380, -0.155027, -0.125276, 0.263029, 0.214930, 0.364728, -0.190322, 0.739109, -0.073140, 0.031019, 0.275554, 0.155606, 0.190134, -0.075498, -0.128868, -0.634680, -0.245930, -0.378038, -0.004445, -0.372350, -0.089359, -0.379229, -0.332185, -0.270731, -0.166999, 0.452315, 0.157703, 0.131554, -0.260259, 0.087691, 0.212348, 0.280758, -0.382113, 0.596506, -0.260249, -0.699067, -0.097714, 0.238885, 0.158642, 0.851427, 0.684368, 0.108845, -0.125174, 0.145198, -0.215527, -0.344915, 0.158572, -0.037705, -0.324388, -0.047033, -0.455977, 0.195006, 0.100975, -0.223898, -0.034713, -0.751085, 0.212994, -0.053669, -0.373534, -0.216103, -0.350119, -0.512587, -0.422205, -0.191687, 0.245188, 0.352775, -0.199634, 0.342956, 0.204863, -0.278915, -0.225503, 0.007357, -0.209864, -0.329487, -0.319577, -0.129340, -0.031544, -0.222602, 0.313674, 0.531743, -0.374551, -0.145260, 0.065582, 0.368865, 0.449404, 0.024641, 0.536455, 0.058853, 0.036585, 0.052503, 0.120726, -0.309278, 0.059893, -0.108878, 0.066551, 0.138443, 0.567835, -0.164525, 0.237544, 0.042580, 0.443305, -0.349076, -0.004278, -0.304528, 0.110469, 0.472584, 0.072931, 0.208199, 0.286284, 0.117245, 0.093040, -0.296115, 0.324456, -0.179557, -0.121246, -0.283000, -0.303930, -0.263620, 0.393149, -0.401854, -0.161018, -0.288490, 0.173856, -0.242550, -0.266600, -0.308466, 0.217126, 0.170010, -0.413150, 0.131288, 0.089754, -0.284599, 0.301959, 0.372722, -0.005831, 0.185591, -0.105822, 0.090043, -0.039276, 0.194986, -0.214666, 0.173998, 0.605422, 0.341914, -0.108069, 0.084163, 0.027850, -0.021812, 0.014308, 0.019655, 0.233833, -0.432867, -0.354916, 0.173912, 0.066179, -0.335677, -0.086665, 0.200079, 0.182208, -0.050544, 0.152536, -0.027049, -0.098200, -0.937390, -0.469690, -0.299395, -0.345973, -0.216834, -0.096939, -0.033776, 0.052189, 0.183709, -0.395913, 0.017638, 0.110112, -0.208640, -0.154128, -0.261726, 0.602001, -0.179281, -0.023590, -0.165796, 0.154767, -0.407140, 0.212813, 0.276566, 0.280525, 0.196769, 0.173377, -0.168094, -0.342753, 0.019288, 0.495078, -0.060080, 0.264583, -0.500601, 0.412453, 0.011923, -0.222416, -0.420082, -0.011814, -0.462620, -0.139731, -0.344890, -0.102732, 0.209938, 0.010297, 0.114575, -0.387051, 0.128237, -0.432484, -0.219626, -0.022716, -0.256000, -0.250074, 0.196972, -0.240456, 0.348659, 0.189229, 0.448523, 0.055522, 0.329682, 0.085357, 0.491020, -0.059267, -0.283609, 0.166553, 0.370823, -0.322035, 0.137636, -0.500068, -0.086893, 0.445958, 0.081688, -0.400789, -0.667837, -0.308214, -0.033264, -0.160742, -0.115348, 0.330842, -0.012683, -0.047024, -0.302543, -0.355480, -0.088434, 0.142573, 0.294445, 0.148821, -0.056949, 0.162241, -0.373000, -0.076817, -0.010065, 0.019920, 0.120578, 0.027282, 0.481974, 0.113932, 0.076293, -0.035964, -0.753017, -0.054522, -0.157620, -0.060275, -0.357035, -0.055351, 0.102809, 0.622629, 0.041624, -0.327667, -0.185988, 0.401746, -0.177432, -0.456752, -0.031861, 0.077705, 0.024977, -0.206408, 0.073406, -0.194622, -0.057263, -0.147799, 0.051283, -0.330984, 0.105458, -0.362897, -0.991919, -0.036350, 0.108381, 0.101568, 0.008090, 0.509524, 0.176072, 0.362198, 0.597342, -0.005970, -0.680218, 0.023825, 0.506910, 0.237766, -0.370509, -0.691265, 0.481777, 0.294625, -0.081179, -0.029373, -0.067685, -0.332369, 0.079393, -0.302186, -0.204714, -0.031663, 0.216011, -0.293198, -0.030497, 0.243244, -0.155338, 0.244067, 0.261514, -0.205362, 0.349204, 0.148735, -0.406445, 0.031919, -0.348895, -0.270666, -0.237656, 0.241379, 0.498529, -0.156424, 0.560587, -0.053088, 0.563798, 0.175464, -0.059034, -0.334456, 0.173023, -0.548596, 0.488490, -0.061640, -0.048056, -0.020205, -0.511038, -0.430719, -0.192647, -0.214764, -0.242390, 0.249758, 0.028799, -0.125548, 0.009193, -0.336883, -0.087217, -0.025591, 0.386569, -0.166210, 0.347886, -0.054686, -0.016476, -0.207555, 0.172757, -0.021911, 0.208317, -0.137092, -0.237714, -0.051269, 0.258135, 0.106486, 0.276405, -0.183884, -0.602314, 0.126345, 0.114380, -0.063238, 0.073658, 0.029867, -0.097185, -0.008189, -0.147346, -0.372063, -0.389081, 0.171521, 0.098724, -0.455837, 0.124189, -0.057794, -0.243790, -0.009284, 0.313391, 0.219130, -0.084302, -0.083348, -0.770049, 0.228755, -0.004559, -0.119465, -0.121491, 0.054778, -0.478681, 0.090265, -0.177298, -0.107635, -0.306583, 0.130618, 0.153524, 0.552819, 0.284570, 0.286044, 0.243219, -0.180258, 0.385127, -0.140085, -0.119886, -0.498030, -0.298768, 0.438359, -0.021139, 0.250634, 0.153530, 0.100155, -0.003552, -0.295562, 0.183706, 0.271540, 0.087671, 0.113943, 0.235245, -0.559447, -0.362721, -0.351374, -0.366559, -0.184664, -0.324071, -0.236337, 0.288803, 0.553762, 0.394592, -0.176806, -0.184274, -0.083054, -0.434748, 0.204528, 0.149122, -0.144529, -0.253641, -0.738241, 0.116636, 0.180948, 0.141944, 0.161791, 0.085380, 0.159774, 0.007237, -0.033937, 0.727049, 0.453890, -0.323438, 0.224269, 0.081925, -0.339957, -0.265953, -0.391387, -0.276736, 0.075189, 0.237483, 0.138082, -0.014768, 0.779782, 0.219798, 0.509592, -0.250035, -0.121638, -0.566326, 0.145709, 0.419123, 0.165370, 0.128867, 0.059019, 0.415348, 0.019952, -0.022489, -0.517906, 0.440196, 0.039877, 0.005727, -0.042588, -0.468147, -0.876123, 0.005329, -0.060168, -0.113577};
  const double SVM_bias =-1.068966  ;
  double sample[900];
  int grayImg[900];
  bool checkSVM(BallPerceptor::Ball &b);
  ColorTable::Colors determineColor(const Image::Pixel& p) const;

#ifdef SAVE_IMAGE
  unsigned int saveImageId = 1;
  unsigned int saveTime = 1;
  bool isSaveImage = false;
#endif
#ifdef SAVE_SAMPLE
  unsigned int saveSampleTime = 1;
#endif

 public:
  BallPerceptor();
    std::vector<candidateBall> possibleBalls;
};
